package com.wang.bootbuilder.entity.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Data
@ApiModel("添加或修改用户的参数")
public class UserParam {

    @ApiModelProperty(value = "Id")
    Long id;

    @NotBlank(message="用户名不能为空")
    @ApiModelProperty(value = "用户名")
    String username;

    @NotBlank(message="密码不能为空")
    @ApiModelProperty(value = "密码")
    String password;

    @ApiModelProperty(value = "联系方式")
    @Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$",message = "手机号码有误")
    String phone;

    @Email(message="邮箱格式不正确")
    @ApiModelProperty(value = "邮箱")
    String email;

    @NotNull(message="权限不能为空")
    @ApiModelProperty(value = "权限Id")
    Long roleId;
}
